def g(a):
    flag = True
    while flag:
        flag = False
        for i in range(len(a)-1):
            if a[i] > a[i + 1]:
                a[i], a[i + 1] = a[i + 1], a[i]
                flag = True
    return a

from time import*

time1 = time()
f1 = open('m1_sorted.txt').readlines()
f1 = list(map(int, f1))
print(*g(f1))
time2 = time()
print('m1_sorted',round(time2 - time1) * 100, ' milliseconds')

time3 = time()
f2 = open('m2_reverse.txt').readlines()
f2 = list(map(int, f2))
print(*g(f2))
time4 = time()
print('m2_reverse ',round(time4 - time3) * 100, ' milliseconds')

time5 = time()
f3 = open('m3_shuffle.txt').readlines()
f3 = list(map(int, f3))
print(*g(f3))
time6 = time()
print('m3_shuffle ',round(time6 - time5) * 100, ' milliseconds')